﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Gui/masterPage.Master" AutoEventWireup="true" CodeBehind="Product.aspx.cs" Inherits="OnlineStore.Gui.Product" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentTitle" runat="server">
    <h1>Chào Mừng ng bạn đến với Shop OnlineStore</h1>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentCenter" runat="server">
    <div>
        <h2> Hãy thỏa sức shopping online cùng shop quần áo rẻ đẹp nhé.</h2>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentTop" runat="server">
    <h1>Sản phẩm Mới nhất - Shop quần áo online</h1>
    
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">
    <asp:DataList ID="mainlist" runat="server" CellPadding="2" CellSpacing="2" 
        RepeatColumns="4" CssClass="list">
    <ItemTemplate>
                   <a href = "/Gui/ProductDetail.aspx?id=<%#DataBinder.Eval(Container.DataItem, "id")%>">
                    <img src="/Bll/ImageHttpHandler.ashx?id=<%# DataBinder.Eval(Container.DataItem,"id")%>" title="<%# DataBinder.Eval(Container.DataItem, "Product_Name")%>" width="120" height="120" alt="<%# DataBinder.Eval(Container.DataItem, "Product_Name")%>"></a><br>
                  <div><img src="../../img/special.png" /><img src="../../img/special.png" /><img src="../../img/special.png" /><img src="../../img/special.png" /><img src="../../img/special.png" /></div>
                 <a href = "/Gui/ProductDetail.aspx?id=<%#DataBinder.Eval(Container.DataItem, "id")%>"><%# DataBinder.Eval(Container.DataItem, "Product_Name")%></a><br>
                 <span style="color: #999; font-size: 11px;"><%# DataBinder.Eval(Container.DataItem, "Type")%></span><br>
                  <span style="color: #900; font-weight: bold;"><%# String.Format("{0:0,0 VNĐ}",DataBinder.Eval(Container.DataItem, "Price"))%> </span> <br>
    </ItemTemplate>
    </asp:DataList>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentButtom" runat="server">
    <div class="pagination">
        
        <%
            int num = OnlineStore.Dal.DalProduct.PageNumber;
            int page = Request.QueryString.Get("page") == null ? 1 : int.Parse(Request.QueryString.Get("page"));
        %>
        <div class="results">Hiển thị từ <%= (page-1)*num %>
         đến
         <%=(page*num <(int)Session["numberItem"])? page*num: (int) Session["numberItem"] %>
          / tổng 
          <%=(int)Session["numberItem"] %> 
          sản phẩm (<%=((int)Session["numberItem"]/OnlineStore.Dal.DalProduct.PageNumber) + 1 %> Trang)</div>
    </div>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Contentlist" runat="server">
    <div class="pagination">
    <div class="links">
        <%
            int page = Request.QueryString.Get("page") == null ? 0 : int.Parse(Request.QueryString.Get("page"));
            for (int i = 1; i <= ((int)Session["numberItem"] / OnlineStore.Dal.DalProduct.PageNumber) + 1; i++)
                if (i == page)
                {
        %>
                    <b><%=i %></b>
        <%
                }
                else
                {
         %>
                <a href=""><%=i%></a>
         <%
                }      
         %>
        </div>
        </div>
</asp:Content>
<asp:Content ID="content7" ContentPlaceHolderID="ContentLogin" runat="server">
    <asp:HyperLink ID="HL_tab_login" runat="server"  NavigateUrl="/gui/Login.aspx" ForeColor="Red">(Đăng nhập) </asp:HyperLink> |
    <asp:HyperLink ID="HL_tab_Logout" runat="server" Visible="false" NavigateUrl="/gui/Login.aspx?logout=true">Đăng Xuất | </asp:HyperLink>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="ContentCartRight" runat="server">
        <asp:GridView ID="ListCartRight" runat="server" AutoGenerateColumns="False" 
           GridLines="None">
            <Columns>
                <asp:BoundField DataField="NumberOrder" SortExpression="NumberOrder" 
                    DataFormatString="{0} x " >
                
                <ControlStyle Width="10px" />
                </asp:BoundField>
                
                <asp:HyperLinkField DataNavigateUrlFields="ID" 
                    DataTextField="Product_Name" 
                    DataNavigateUrlFormatString="/gui/ProductDetail.aspx?id={0}" />
            </Columns>
        </asp:GridView>
    <br>
    <table cellpadding="0" cellspacing="0" align="right" style="display:inline-block;">
     <tbody>
        <tr>
            <td align="right"><span class="cart_module_total"><b>Tiền hàng:</b></span></td>
            <td align="right">
                <asp:Label ID="lb_Sum_product" runat="server" CssClass="cart_module_total" >0 VNĐ</asp:Label>
             </td>
        </tr>
        <tr>
            <td align="right"><span class="cart_module_total"><b>Tổng cộng:</b></span></td>
            <td align="right"><span class="cart_module_total">
                <asp:Label ID="lb_Sum" runat="server" CssClass="cart_module_total">0 VNĐ</asp:Label></span></td>
        </tr>
     </tbody></table>
</asp:Content>